//
//  YuUserDefaultsUtilities.m
//  HuLaQuan
//
//  Created by hok on 1/5/16.
//  Copyright © 2016 Jianghao. All rights reserved.
//

#import "YuUserDefaultsUtilities.h"

@implementation YuUserDefaultsUtilities

+ (NSUserDefaults *)userDefaults
{
    return [NSUserDefaults standardUserDefaults];
}
//save
+(void)saveValue:(id) value forKey:(NSString *)key{
    [[YuUserDefaultsUtilities userDefaults] setObject:value forKey:key];
    [[YuUserDefaultsUtilities userDefaults] synchronize];
}
//get
+(id)valueWithKey:(NSString *)key{
    return [[YuUserDefaultsUtilities userDefaults] objectForKey:key];
}

+(id)stringWithKey:(NSString *)key
{
    return [[YuUserDefaultsUtilities userDefaults] stringForKey:key];
}

+(BOOL)boolValueWithKey:(NSString *)key
{
    return [[YuUserDefaultsUtilities userDefaults] boolForKey:key];
}

+(void)saveBoolValue:(BOOL)value withKey:(NSString *)key
{
    [[YuUserDefaultsUtilities userDefaults] setBool:value forKey:key];
    [[YuUserDefaultsUtilities userDefaults] synchronize];
}

+(void)print{
    NSDictionary *dic = [[YuUserDefaultsUtilities userDefaults] dictionaryRepresentation];
    DLog(@"%@",dic);
}

@end
